Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

301
Visualizações
Troubleshooting a Java program that causes a server to hang with "too many files open"

I have a Java program runs (on linux) for a while and then causes the server to lock up with "Too many files open"

After restarting the machine, I run the java program again and then execute the lsof command against it's pid. A large number of lines with the following output are produced:

java    971 uknown  980u     sock                0,9       0t0  20461 protocol: TCPv6

Does this means the program is opening multiple tcp connections & not closing them?

What further steps can i take to troubleshoot this?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

It means your program is opening file descriptors but not closing them. It may be sockets or file handlers. So it is causing resource leak. Make sure all file handlers are closed and make it ready for garbage collected.

As dan1st pointed out in comment, one preventive measure to avoid this scenario is using try-with-resources. This will implements the AutoClosable interface and make sure automatic resource closing.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda